<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid columns="1" style="width:100%">
		<h:panelGrid columns="2" style="width:100%">
			<p:commandButton value="Catch"
				actionListener="#{weeklyController.loadInStockNotInCurrentWeeklyForCurrent}"
				update=":detailForm" style="float:left;background-color:orange"
				title="Catch product in stock, but not in current week">
			</p:commandButton>
			<h:commandLink value="Print" style="color:green;font-weight:bold;float:right">
				<p:fileDownload
					value="#{weeklyController.inStockNotInCurrentWeeklyPdf}"></p:fileDownload>
			</h:commandLink>
		</h:panelGrid>
		<p:dataTable var="product"
			value="#{weeklyModel.current.inStockNotInWeeklyProducts}"
			paginator="true" rows="20"
			rowsPerPageTemplate="5,7,10,15,20,30,40,50" filterEvent="enter"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			style="font-size:0.9em">

			<p:column sortBy="#{product.id}" style="width:30px">
				<h:outputText value="#{product.id}" />
			</p:column>


			<p:column sortBy="#{product.number}" style="width:50px">
				<h:outputText value="#{product.number}" />
			</p:column>
			<p:column sortBy="#{product.chineseName}"
				filterBy="#{productPrice.product.chineseName}"
				filterMatchMode="contains">
				<h:graphicImage library="images" value="../#{product.icon}16.png"></h:graphicImage>
				<h:outputText value="#{product.chineseName}" />
			</p:column>
			<p:column sortBy="#{product.name}" filterBy="#{product.name}"
				filterMatchMode="contains">
				<h:outputText value="#{product.name}" />
			</p:column>

			<p:column sortBy="#{product.type.label}"
				filterBy="#{product.type.label}" filterMatchMode="contains">
				<h:outputText value="#{product.type.label}" />
			</p:column>

			<p:column headerText="price" sortBy="#{product.price}"
				style="width:70px">
				<h:outputText value="#{product.price}" />
			</p:column>
			<p:column headerText="Special price" sortBy="#{product.specialPrice}"
				style="width:120px">
				<h:outputText value="#{product.specialPrice}" />
			</p:column>
			<p:column headerText="inventory" sortBy="#{product.inventory}"
				style="width:70px">
				<h:outputText value="#{product.inventory}" />
			</p:column>
			<p:column headerText="Stock Unit" sortBy="#{product.stockUnitLabel}"
				style="width:100px">
				<h:outputText value="#{product.stockUnitLabel}" />
			</p:column>
			<p:column headerText="Stock Unit Desc"
				sortBy="#{product.specificationDescLabel}" style="width:150px">
				<h:outputText value="#{product.specificationDescLabel}" />
			</p:column>
		</p:dataTable>


	</h:panelGrid>
</ui:composition>
</html>